<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>薪资账套</title>
<script type="text/javascript"src="<c:url value="/js/jquery-easyui-1.5.4.2/jquery.min.js"/>"></script>
<script type="text/javascript"src="<c:url value="/js/jquery-easyui-1.5.4.2/jquery.easyui.min.js"/>"></script>
<script type="text/javascript"src="<c:url value="/js/jquery-easyui-1.5.4.2/locale/easyui-lang-zh_CN.js"/>"></script>
<link rel="stylesheet" type="text/css"href="<c:url value="/js/jquery-easyui-1.5.4.2/themes/default/easyui.css"/>" />
<link rel="stylesheet" type="text/css"href="<c:url value="/js/jquery-easyui-1.5.4.2/themes/icon.css"/>" />
<style type="text/css">
		.insert_bt {
			background: #CDDEF4;
		}
	</style>
</head>
<body>
	
	<script type="text/javascript">
		$(function() {
			$(function(){
				$('.return_pay').linkbutton({
					onClick : function() {
						$(".insert_pay").panel({
							href : "Payroll"
						});
					}
				});
			});
			$("#cc").combobox({
				editable:false
			});
			//添加按钮，进行弹框
			$('#account_Id').textbox({
				icons:[{
					iconCls:'icon-add',
					handler:function(e){
						$('#lq_pay_ProjectTemplate').dialog('open');
						//双击获取值
						$('#lq_pay_insert').datagrid({onDblClickRow:function(index,row){
							var account_Id=row.accountId;
							var template_name=row.accountName;
							$('#account_Id').textbox('setValue',account_Id);
							alert(row.accountId);
							$('#template_Name').textbox('setValue',template_name);
								//关闭窗口
								$('#lq_pay_ProjectTemplate').dialog('close');
							}
						});
					}
				}]
			});
			$("#lq_save_btn_pay_addr").linkbutton({onClick:function(){
				$("<form method='post'>").appendTo(document.body).form({
					url: 'lzs_findAllduozjsocialpayroll',
					onSubmit: function(params){
						params["salaryId"] = $("#salaryId").textbox("getText");
						params["salaryName"] = $("#salaryName").textbox("getText");
						params["accountId"] = $("#account_Id").textbox("getText");
						params["salaryNumberEmployees"] = $("#salaryNumberEmployees").textbox("getText");
						params["salsrySum"] =$("#salsrySum").textbox("getText");
						
					},
					success:function(v){
						v = eval("(" + v + ")");
						if(v.success){
							$(".insert_pay").panel({
								href : "Payroll"
							});
						}else{
							$.messager.alert('错误', '对不起，操作失败，原因：' + v.message);
						}
					}
				}).submit();
			}});
		});
		
	</script>
	
	<div class="easyui-panel insert_pay "data-options="fit:true,border:false,tools:'#insert_bt'">
		<!-- 按钮 -->
		<div id="insert_bt" class="insert_bt">
			<a href="#" class="easyui-linkbutton return_pay" iconCls="icon-undo"
				plain="true" title="返回" data-options="text:'返回'"></a> 
			
			<span style="float:right; font-size: 12px; margin-top: 5px;margin-right:15px;">新增：薪资账套</span>
		</div>
		<!-- 添加面板 -->
		<div style="height: 10px;"></div>
		<div style="margin-left: 10px">
			<div style="font-size: 14px;">概要</div>
			<div
				style="border-top: 2px solid #2B91D5; width: 860px;display: inline-block; margin-right: 15px; padding-top: 10px;">
			</div>
		</div>
			<div>
				<table cellspacing="10" style="margin-left: 50px;">
					<tbody>
						<tr>
							<td><input class="easyui-textbox" id="salaryId"
								data-options="label:'  *薪资表编号', width:250,labelWidth:130" /></td>
						</tr>
						<tr>
							<td><input class="easyui-textbox" id="salaryName"
								data-options="label:' 名称', width:250,labelWidth:130" /></td>
						</tr>
						<tr>
							<td><input class="easyui-textbox" id="salaryNumberEmployees"
								data-options="label:' 员工数 ', width:250,labelWidth:130" /></td>
						</tr>
						<tr>
								<td><input class="easyui-textbox" id="account_Id"  
									data-options="label:'所属账套', width:250,labelWidth:130	" /></td>
								<td><input class="easyui-textbox" style="width: 80px;"  id="template_Name"/></td>
						</tr>
						<tr>
							<td><input class="easyui-textbox" id="salsrySum"
								data-options="label:'薪资合计', width:250,labelWidth:130" /></td>
						</tr>
						<!-- <tr>
							<td><input class="easyui-datetimebox" id="accountEnddate"
								data-options="label:'*结束时日', width:250,labelWidth:130" /></td>
						</tr> -->
						<!-- <tr>
							<td>组权限
								<span style="margin-left: 90px"></span>
								<select id="cc" class="easyui-combobox" name="dept" style="width:200px;">   
    								<option>bitem1</option>   
    								<option>bitem2</option>   
   									<option>bitem3</option>   
								</select>  
							</td>
						</tr> -->
					</tbody>
				</table>
			</div>
			<div style="font-size: 14px;margin-left: 10px">备注</div>
			<div
				style="border-top: 2px solid #2B91D5; width: 860px; height: 130px; display: inline-block;margin-left: 10px; margin-right: 15px; padding-top: 10px;">
				<input id="remark" class="easyui-textbox"
					data-options="width:860,height:100,multiline:true" />
			</div>
			
			<div style="margin-left: 10px;">
			<a id="lq_save_btn_pay_addr" class="easyui-linkbutton " data-options="text:'保存',iconCls:'icon-ok',plain:true"style="background:#CDDEF4"></a>
			</div>
		</div>
		<!-- 薪资模板选择弹框 -->
		<div class="easyui-dialog" id="lq_pay_ProjectTemplate"
			data-options="width:550,height:400,title:'薪资模板选择',
				modal:true,
				closed:true,
				buttons:[{
					text:'确定',
					iconCls:'icon-ok',
					handler:function(){
						<!-- row获取选中行 -->
						var row=$('#lq_pay_insert').datagrid('getSelected');
						<!-- paperinsertid获取行id，paperinsertname获取行name -->
						var account_Id=row.accountId;
						var template_name=row.accountName;
						<!-- 传值 -->
						$('#account_Id').textbox('setValue',account_Id);
						$('#template_Name').textbox('setValue',template_name);
						<!-- 关闭窗口 -->
						$('#lq_pay_ProjectTemplate').dialog('close');
					}
				},{
					text:'取消',
					iconCls:'icon-clear',
					handler:function(){
						$('#lq_pay_ProjectTemplate').dialog('close');		
					}
				}]">
			<div id="lq_pay_insert_tb">
				<div class="line">
					<input class="easyui-textbox "
						data-options="label:'薪资模板编号',width:350,labelWidth:130" />
				</div>
				<div class="line">
					<input class="easyui-textbox"
						data-options="label:'薪资模板名称',width:350,labelWidth:130" />
					<a class="easyui-linkbutton"
						data-options="text:'搜索',width:100" style="float: right" />
				</div>
			</div>
			<div class="easyui-panel" data-options="fit:true,border:false" >
				<table class="easyui-datagrid" id="lq_pay_insert"
					data-options="
							fit:true,
							singleSelect:true,
							nowrap:true,
							rownumbers:true,
							toolbar:'lq_pay_insert_tb',
							<!-- 分页 -->			
							pagination:true,
							url:'lzs_findAllduoSalary',
							pageSize:5,
							pageList:[5,10,15]">
					<thead>
						<tr>
							<th data-options="width:140,align:'center',field:'accountId'" id="insert_templateId">账套编号</th>
							<th data-options="width:270,align:'center',field:'accountName'" id="insert_templateName">账套名称</th>
						</tr>
					</thead>
					<tbody>
						
					</tbody>
				</table>
			</div>
		</div>
</body>
</html>